.TH E1432_SET_SOURCE_SPAN 3 E1432
.SH NAME
.nf
e1432_set_source_span \- Set source span
e1432_get_source_span \- Get source span
.fi
.IX e1432_set_source_span(3) 3
.IX e1432_get_source_span(3) 3
.SH SYNOPSIS
.cS
SHORTSIZ16 e1432_set_source_span(E1432ID hw, SHORTSIZ16 ID, FLOATSIZ32 span)
SHORTSIZ16 e1432_get_source_span(E1432ID hw, SHORTSIZ16 ID, FLOATSIZ32 *span)
.cE
.SH DESCRIPTION

\fIe1432_set_source_span\fR sets the source bandwidth.  This specifies
the maximum frequency at which the output signal will correctly track
the signal that the source is attempting to generate.

The valid values for \fIspan\fR depend of the current clock frequency,
which is set by \fIe1432_set_clock_freq\fR.  The clock frequency
should be set before setting the span.  Normally, the maximum valid
span is max_span = clock_freq/2.56.  Valid spans are max_span divided
by powers of two, and max_span divided by five and by powers of two.
The ratio between the span and the max_span is called the decimation
factor.

The maximum number of decimate-by-two passes allowed by the source is 16,
so the maximum decimation factor is 5*2^16.

The effective sample rate, which is the rate at which data is received
from an input or used by a source, is normally equal to 2.56 times the
span.

In certain cases, some of the frequencies above the maximum span may
still contain valid alias-protected data. However, this function ignores
the extra bandwidth, and pretends that the maximum span is always
1/2.56 times the effective sample rate.

Filter settling is not performed on source channels during the 
measurement initialization process when the decimation factor is 
greater than 5*2^9.

\fIe1432_get_source_span\fR returns the current span in Hertz.  All source
channels in the same SCA have the same span.

The default setting is 0 Hz. This is a special case, in which the source
is actually set to the measurement span.

\fIhw\fR must be the result of a successful call to
\fIe1432_assign_channel_numbers\fR, and specifies the group of
hardware to talk to.

\fIID\fR is either the ID of a group of channels that was obtained with a
call to \fIe1432_create_channel_group\fR, or the ID of a single
channel.

\fIspan\fR is the desired span, in Hz.  It is rounded up to the next
larger valid span.

This function is used in order to set a source channel to a different
span than the input channels in a measurement.  However, even if the
module is an E1434 and has no input channels, it is a good idea to
also use \fIe1432_set_span\fR to tell the module what span other input
modules are using.  That way, if the source module is doing source
triggering, it knows how much decimation the inputs are doing and can
ensure that the source trigger lines up with the decimated input data.

.SH "RESET VALUE"
After a reset, each source channel is set to a span of 0 Hz.
.SH "RETURN VALUE"
Return 0 if successful, a (negative) error number otherwise.
.SH "SEE ALSO"
.na
e1432_set_clock_freq, e1432_set_span, e1432_get_source_span_limits
.ad
